#include <iostream>
using namespace std;
void findTwoNumbersSum(int arr[],int length,int x)
{
	if(arr == nullptr || length<=0)
		return;
	int head = 0 ,tail = length-1;
	int sum = arr[head] + arr[tail];
	while(head < tail && sum != x)
	{
		if(sum > x)
			--tail;
		else
			++head;
		sum = arr[head] +arr[tail];
	}
	if(head == tail)
		cout<<"not found"<<endl;
	else
		cout<<arr[head]<<" , "<<arr[tail]<<endl;
}


int main()
{
	int arr[] = {1,2,4,7,11,15,25};
	findTwoNumbersSum(arr,7,15);
	findTwoNumbersSum(arr,7,21);

	system("pause");
	return 0;
}